<?php

class admin_Form_Login extends Zend_Form
{

    public function init()
    {
        $this->setMethod('post');

        $this->clearDecorators()
                ->addDecorator('FormElements')
                ->addDecorator('HtmlTag', array('tag' => 'p', 'class' => 'main'))
                ->addDecorator('Form')
                ->setElementDecorators(array(
                    array('ViewHelper'),
                    array('Errors'),
                    array('Description', array('tag' => '', 'class' => '')),
                    array('Label', array('separator' => ' ')),
                    array('HtmlTag', array('tag' => '', 'class' => '')
                    )
                ));

        $correo = $this->createElement('text', 'correo');
        $correo->addFilters(array('StringTrim', 'StringToLower'))
                ->addValidator('EmailAddress', true)
                ->setRequired(true)
                ->setLabel('Correo')
                ->setAttrib('class', 'caja');

        $clave = $this->createElement('password', 'clave');
        $clave->addFilters(array('StringTrim', 'StringToLower'))
                ->addValidators(array('Alnum', array('StringLength', false, array(4, 8))))
                ->setRequired(true)
                ->setLabel('Clave')
                ->setAttrib('class', 'caja');

        $login = $this->createElement('submit', 'login');
        $login->setRequired(false)
                ->setIgnore(true)
                ->setLabel('Login')
                ->setAttrib('class', 'login');

        $this->addElements(array($correo, $clave, $login));
    }


}

